package com.wisezone.demo0210;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Student student=null;
        List<Student> students =new ArrayList<>();

        Scanner scanner=new Scanner(System.in);
        String code=null;
        String strY="";
        while(true){
            System.out.println("输入学生的学号：");
            code=scanner.next();


            student =new Student();
            student.setCode(code);

            students.add(student);

            System.out.println("是否继续添加学生（y/n）");
            strY=scanner.next();
            if(!"y".equals(strY)){
                break;
            }
        }
    }
}
